#define  _CRT_SECURE_NO_WARNINGS


#include<stdio.h>

int main()
{
	int a = 0, b = 0, i = 0, sum_a = 0, sum_b = 0;
	scanf("%d %d", &a, &b);
	for (i = 1; i <= a / 2; i++)
	{
		if (a % i == 0)
			sum_a += i;
	}
	for (i = 1; i <= b / 2; i++)
	{
		if (b % i == 0)
			sum_b += i;
	}
	if (sum_a == b && sum_b == a)
		printf("yes\n");
	else
		printf("no\n");
	return 0;
}